<template>
    <div>
<table class="table table-bordered">
    <tbody>
        <tr>
            <td align="right">姓名</td>
            <td><input type="text" v-model="data.usename"></td>
        </tr>
        <tr>
            <td align="right">密码</td>
            <td><input type="password" v-model="data.usepow"></td>
        </tr>
        <tr>
            <td></td>
            <td><input type="button" value="登录" @click="log"></td>
        </tr>
    </tbody>
</table>
    </div>
</template>

<script setup lang="ts">
import {ref,reactive}from 'vue'
let data=reactive({
    usename:'',
    usepow:''
})
const log=()=>{
    if(data.usename==""){
        alert('用户名不能为空');
        return;
    }
    if(data.usepow==""){
        alert('密码不能为空');
        return;
    }
}
</script>

<style scoped>

</style>